#include "precompiled.h"
#include "frmTreeTest.h"
using namespace frmTreeTest;

///////////////////////////////////////////////////////////////////////////////

//
void frmTreeTest::Test()
{
  odb::TConnect Connect;
    Connect.AliasName = 
      "Provider=LCPI.IBProvider;"
      "data source=localhost:c:\\Documents and Settings\\sergeyka\\VisualC\\Projects\\TestAll\\odb.gdb;"
      "auto_commit=true;"
      "ctype=win1251;"; 
    Connect.UserName = "sysdba";
    Connect.Password = "masterkey";
    Connect.TypeClient = rdb::TConnect::TType::EType_Firebird;
  Connect.Update();

  frmTree::TParam Param(Connect);
  frm::control::TWindow Win;

  frm::control::TFrame *Frame = new frm::control::TFrame(Win);
    Frame->SetRuleWidth (new frm::geometry::TParent);
    Frame->SetRuleHeight(new frm::geometry::TParent);

    Frame->Client->SetRuleWidth (new frm::geometry::TChildrenMax);
    Frame->Client->SetRuleHeight(new frm::geometry::TChildrenMax);
  Win.Client.AddChildLast(Frame);

  frmTree::TTable *Table = new frmTree::TTable(Win,Param);
  Frame->Client->AddChildLast(Table);
 
    frmTree::TRow *Row = new frmTree::TRowFolderRecord(*Table);
      Row->RecordId = 8;
    Table->Grid->AddChildLast(Row);

    //frmTree::TCmdLoadChildren(*Row).Execute();

      //frmTree::TRow *Row1 = new frmTree::TRowTableRecord(*Table);
      //Row->Children->AddChildLast(Row1);



  frmTree::TStyles Styles;
  Win.Client.SetTableOfStyles(&Styles);
  Win.Client.InheritStyle();

  Row->UpdateExpand(true);

  Win.SetWindowRect(grf::TRect(100,100,600,600),false);
  Win.Show();
  Win.MessagesLoop();
  
  //Win.Client.DeleteChildren();
}